package com.ufida.ids.model;

// Generated 2012-3-27 14:08:00 by Hibernate Tools 3.4.0.CR1

import java.io.Serializable;
import java.sql.Clob;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * StaffModel generated by hbm2java
 */
@Entity
@Table(name = "IDS_STAFF")
public class StaffModel implements java.io.Serializable {

	private Long staffId;
	//private OrgModel orgModel;
	private Long orgId;
	private String staffCode;
	private String staffName;
	private Short sex;
	private Date birthday;
	private String birthdayStr;
	private String idcardNo;
	private String tel;
	private String mobile;
	private String email;
	private String address;
	private String postcode;
	private String photo;
	private String loginName;
	private String password;
	private String problem;
	private String answer;
	private String memo;
	private Short entityStatus;
	private String creator;
	private Date createTs;
	private String createTsStr;
	private String lastModifier;
	private Date modifiedTs;
//	private Set<UserMappingModel> userMappingModels = new HashSet<UserMappingModel>(0);
//	private Set<PostStaffModel> postStaffModels = new HashSet<PostStaffModel>(0);

	public StaffModel() {
	}

	public StaffModel(String staffName, Short sex) {
		this.staffName = staffName;
		this.sex = sex;
	}

	public StaffModel(OrgModel orgModel, String staffCode, String staffName, Short sex, Date birthday,
			String idcardNo, String tel, String mobile, String email, String address, String postcode, String photo,
			String loginName, String password, String problem, String answer, String memo, Short entityStatus,
			String creator, Date createTs, String lastModifier, Date modifiedTs,
//			Set<UserMappingModel> userMappingModels, Set<PostStaffModel> postStaffModels) {
			Set<UserMappingModel> userMappingModels, Set<PostStaffModel> postStaffModels, Long orgId) {
		//this.orgModel = orgModel;
		this.staffCode = staffCode;
		this.staffName = staffName;
		this.sex = sex;
		this.birthday = birthday;
		this.idcardNo = idcardNo;
		this.tel = tel;
		this.mobile = mobile;
		this.email = email;
		this.address = address;
		this.postcode = postcode;
		this.photo = photo;
		this.loginName = loginName;
		this.password = password;
		this.problem = problem;
		this.answer = answer;
		this.memo = memo;
		this.entityStatus = entityStatus;
		this.creator = creator;
		this.createTs = createTs;
		this.lastModifier = lastModifier;
		this.modifiedTs = modifiedTs;
//		this.userMappingModels = userMappingModels;
//		this.postStaffModels = postStaffModels;
		this.orgId = orgId;
	}

	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "STAFF_ID", unique = true, nullable = false, precision = 10, scale = 0)
	public Long getStaffId() {
		return this.staffId;
	}

	public void setStaffId(Long staffId) {
		this.staffId = staffId;
	}

//	@ManyToOne(fetch = FetchType.LAZY)
//	@JoinColumn(name = "ORG_ID")
//	public OrgModel getOrgModel() {
//		return this.orgModel;
//	}
//
//	public void setOrgModel(OrgModel orgModel) {
//		this.orgModel = orgModel;
//	}

	@Column(name = "STAFF_CODE", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}

	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}

	@Column(name = "STAFF_NAME", nullable = false, length = 20)
	public String getStaffName() {
		return this.staffName;
	}

	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}

	@Column(name = "SEX", nullable = false, precision = 22, scale = 0)
	public Short getSex() {
		return this.sex;
	}

	public void setSex(Short sex) {
		this.sex = sex;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "BIRTHDAY", length = 7)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "IDCARD_NO", length = 30)
	public String getIdcardNo() {
		return this.idcardNo;
	}

	public void setIdcardNo(String idcardNo) {
		this.idcardNo = idcardNo;
	}

	@Column(name = "TEL", length = 50)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "MOBILE", length = 30)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "EMAIL", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "ADDRESS", length = 300)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "POSTCODE", length = 10)
	public String getPostcode() {
		return this.postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	
	@Column(name = "LOGIN_NAME", length = 20)
	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Column(name = "PASSWORD", length = 200)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "PROBLEM", length = 10)
	public String getProblem() {
		return this.problem;
	}

	public void setProblem(String problem) {
		this.problem = problem;
	}

	@Column(name = "ANSWER", length = 10)
	public String getAnswer() {
		return this.answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	@Column(name = "MEMO", length = 2000)
	public String getMemo() {
		return this.memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Column(name = "ENTITY_STATUS", precision = 22, scale = 0)
	public Short getEntityStatus() {
		return this.entityStatus;
	}

	public void setEntityStatus(Short entityStatus) {
		this.entityStatus = entityStatus;
	}

	@Column(name = "CREATOR", length = 20)
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "CREATE_TS")
	public Date getCreateTs() {
		return this.createTs;
	}

	public void setCreateTs(Date createTs) {
		this.createTs = createTs;
	}

	@Column(name = "LAST_MODIFIER", length = 20)
	public String getLastModifier() {
		return this.lastModifier;
	}

	public void setLastModifier(String lastModifier) {
		this.lastModifier = lastModifier;
	}

	@Column(name = "MODIFIED_TS")
	public Date getModifiedTs() {
		return this.modifiedTs;
	}

	public void setModifiedTs(Date modifiedTs) {
		this.modifiedTs = modifiedTs;
	}

//	@OneToMany(fetch = FetchType.LAZY, mappedBy = "staffModel")
//	public Set<UserMappingModel> getUserMappingModels() {
//		return this.userMappingModels;
//	}
//
//	public void setUserMappingModels(Set<UserMappingModel> userMappingModels) {
//		this.userMappingModels = userMappingModels;
//	}
//
//	@OneToMany(fetch = FetchType.LAZY, mappedBy = "staffModel")
//	public Set<PostStaffModel> getPostStaffModels() {
//		return this.postStaffModels;
//	}
//	
//	public void setPostStaffModels(Set<PostStaffModel> postStaffModels) {
//		this.postStaffModels = postStaffModels;
//	}
	
	@Column(name = "ORG_ID")
	public Long getOrgId() {
		return orgId;
	}
	
	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}

	@Transient
	public String getCreateTsStr() {
		return createTsStr;
	}

	public void setCreateTsStr(String createTsStr) {
		this.createTsStr = createTsStr;
	}

	@Column(name = "PHOTO", length = 100)
	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Transient
	public String getBirthdayStr() {
		return birthdayStr;
	}

	public void setBirthdayStr(String birthdayStr) {
		this.birthdayStr = birthdayStr;
	}
}
